{template 'header'}
{if $reply['status']==0 || $reply['status']==""}
<div class="alert alert-warning" style="text-align:center;position: fixed;top:40%;z-index: 2; width:80%;margin:0 10%;">活动已禁用！</div>
<div class="weui_mask"></div>
{/if}


<img src="{$voteuser['img1']}" alt="shareImg" width="0px" height="0px" style="display: block;" />

<div id="focus" class="focus focus2" style="">
	<div class="hd">
		<ul>
			<li class="on"></li>
		</ul>
	</div>
	<div class="bd">
		<ul>
   		</ul>
	</div>
</div>
<style>
{if $reply['diamondmodel']==1}
.divbottommenu .divitem{width:20%;}
{/if}
{if $reply['diamondmodel']==2}
.divbottommenu .divitem{width:33.33333%;}
{/if}
</style>
<div class="divbottommenu">
  <div class="divitem"><div class="divtxt">{$voteuser['id']}号</div>
    <div class="divline"></div>
  </div>
  <div class="divitem"><div class="divtxt">{$voteuser['name']}</div>
    <div class="divline"></div>
  </div>
  <div class="divitem"><div class="divtxt"><font id="upiao">{$voteuser['votenum']}</font> 票</div>
    <div class="divline"></div>
  </div>
  {if $reply['diamondmodel']==1}
  <div class="divitem"><div class="divtxt">{$voteuser['eggnum']} <img src="{MODULE_URL}/template/static/images/egg.png" width="15"><div class="divline"></div></div>
  </div>
  {/if}
  {if $reply['diamondmodel']!=2}
  <div class="divitem"><div class="divtxt">{$voteuser['diamondnum']} <img src="{MODULE_URL}/template/static/images/zuan.gif" width="15"></div>
  </div>
  {/if}

</div>

<div class="divview2">
<span>我的介绍：{$voteuser['introduction']}</span>
{if $reply['ischecked']==1 && $voteuser['status']==0}
<span class="label label-danger">待审核</span>
{/if}
</div>

<div class="vsavz">  
<div class="vsav">  
    <span class="left"><div class="vbtn3"><a href="{php echo $this->createMobileUrl('ranking', array('rid' => $rid))}">热度：{$pvtotal['pv_total']}</a></div></span>  
    <span class="right"><div class="vbtn" onclick='$("#share").show();'>分享拉票</div></span>                
</div>



    {if $voteuser['openid']!=$userinfo['openid'] && $myvoteid!=""}
		<div class='vsav'><div class='vbtn_tnk'><a href='{php echo $this->createMobileUrl('view', array('rid' =>  $reply['rid'],'id' => $myvoteid))}'>我的投票</a></div></div>
    {else}
	    {if $voteuser['openid']!=$userinfo['openid']}
        <div class='vsav'><div class='vbtn_tnk'><a href='{php echo $this->createMobileUrl('join', array('rid' => $reply['rid']))}'>我也要参加</a></div></div>
		{/if}
    {/if}
</div> 

<div class="view2">
{if $voteuser['img1']!=''}<img src="{$voteuser['img1']}">{/if}
{if $voteuser['img2']!=''}<img src="{$voteuser['img2']}">{/if}
{if $voteuser['img3']!=''}<img src="{$voteuser['img3']}">{/if}
{if $voteuser['img4']!=''}<img src="{$voteuser['img4']}">{/if}
{if $voteuser['img5']!=''}<img src="{$voteuser['img5']}">{/if}
</div>

<div class="vsavz">  

{if $voteuser['openid']!=$userinfo['openid'] && $myvoteid!=""}
		<div class='vsav'><div class='vbtn_tnk'><a href='{php echo $this->createMobileUrl('view', array('rid' =>  $reply['rid'],'id' => $myvoteid))}'>我的投票</a></div></div>
{else}
	    {if $voteuser['openid']!=$userinfo['openid']}
        <div class='vsav'><div class='vbtn_tnk'><a href='{php echo $this->createMobileUrl('join', array('rid' => $reply['rid']))}'>我也要参加</a></div></div>
		{else}
		<div class='vsav'><div class='vbtn_tnk'><a href='{php echo $this->createMobileUrl('view', array('rid' => $reply['rid'],'id' => $voteuser['id']))}'>刷新</a></div></div>
		{/if}
{/if}
</div> 
<div class="zuanlist">
   <ul>
   
   </ul>
   <div id="list_more" class="box" style="margin-top: 16px; text-align: center;margin-bottom: 40px;"><span class="am-text-secondary" onclick="get_list(0);">查看更多</span></div>
</div>


<div style="height:80px;"></div>


{if $reply['diamondmodel']==0}
<div class="lapiao">
<a href="{php echo $this->createMobileUrl('index', array('rid' => $rid))}" class='l'>回首页</a><a href="{php echo $this->createMobileUrl('payvote', array('rid' => $reply['rid'],'id' => $voteuser['id'],'ty'=>'zuan'))}" class='r'>钻石</a><div class="add" id="mytoupiao"><div class="i"><i><img src="{MODULE_URL}/template/static/images/xin.png"></i>投票</div></div>
</div>
{/if}
{if $reply['diamondmodel']==1}
<div class="lapiao2">
<a href="{php echo $this->createMobileUrl('index', array('rid' => $rid))}" class='l'>回首页</a><a href="{php echo $this->createMobileUrl('payvote', array('rid' => $reply['rid'],'id' => $voteuser['id'],'ty'=>'jd'))}" class='jd'>鸡蛋</a><a href="{php echo $this->createMobileUrl('payvote', array('rid' => $reply['rid'],'id' => $voteuser['id'],'ty'=>'zuan'))}" class='r'>钻石</a><div class="add" id="mytoupiao"><div class="i"><i><img src="{MODULE_URL}/template/static/images/xin.png"></i>投票</div></div>
</div>
{/if}
{if $reply['diamondmodel']==2}
<div class="lapiao">
<a href="{php echo $this->createMobileUrl('index', array('rid' => $rid))}" class='l'>回首页</a><div class="add" id="mytoupiao"><div class="i"><i><img src="{MODULE_URL}/template/static/images/xin.png"></i>投票</div></div>
</div>
{/if}
<div class="follow" id="follow" style="display:none">
<div class="weui_mask"></div>
<div id="guanzhubox" >
	<div class="box1" onclick="hidemod('follow');">
	<span class="span1">未关注</span> 
	<span class="span2" >关闭</span></div>
	<div class="divtxt">
	<p>长按下方二维码，长按，识别二维码</p>
	<p><img src="{php echo $_W['account']['qrcode'];}" width="80%" ></p>
	{$reply['followguide']}</div>
</div>
</div>
<div class="share" id="share" style="display:none">
<img src="{MODULE_URL}/template/static/images/share.png" style="position: absolute;top: 0;right:0;z-index: 2;" onclick="hidemod('share');" width="100%"  />
<div class="weui_mask" onclick="hidemod('share');"></div>
</div>
<div class="smile" id="smile" style="display:none"onclick="hidemod('smile');">
   <div class="smileicon"><img src="{MODULE_URL}/template/static/images/smile/1.png" onclick="hidemod('smile');" style="    margin-left: 50%;" width="100%"  /></div>
   <div class="votets">投票成功，今天您还可以投5票。:-D</div>
<div class="weui_mask" onclick="hidemod('smile');"></div>
</div>

<script>
$(document).ready(function(){
    $("#mytoupiao").click(function(){
	loadingToast("投票中");
   	$.ajax({
		type: "POST",
		url: "{php echo $this->createMobileUrl('vote', array('rid' => $reply['rid'],'id' => $voteuser['id']))}",
		data: {votetype:0},
	    dataType: "json",
	    success: function(str) {
		    hidemod("loadingToast");
			if(str!=null && str!=''){
				if(str.status == 1){
				    $(".votets").html(str.msg);
					var smile="{MODULE_URL}/template/static/images/smile/"+GetRandomNum(1,22)+".png";
					$(".smileicon img").attr('src',smile);
					$("#smile").show();
				}else if(str.status == 0){
					dialog2(str.msg);
				}else if(str.status == 500){
					$("#follow").show();
				}else{
				    dialog2(str.msg);
				}
			}
	    },
	    error: function(err) {
	    	dialog2("发生错误，请刷新后重试！");
	    }
	});
	});

});


var limit = 1;
function get_list(){	
	$("#list_more").html('<div class="am-text-secondary"><span class="am-icon-spinner am-icon-spin"></span> 卖命加载中...</div>');
	$.ajax({
	    type : "post",
	    url : "{php echo $this->createMobileUrl('view',array('rid'=>$rid,'id'=>$id))}",
	    data : {
	    	limit:limit,
	    },
        dataType : "json",		
	    success : function(data) {
	    	if(data.status==200){
						var list = data.content;
						var content = '';
						$(".zuanlist ul").append(list);
						for(var i=0; i<list.length; i++){
							  content = '<li><img src="'+list[i]['avatar']+'"><p>'+list[i]['cont']+'<br/><span>'+list[i]['createtime']+'</span></p></li>';
							$(".zuanlist ul").append(content);
						}
						if(list.length==10){
							$("#list_more").html('<span class="am-text-secondary" onclick="get_list();">查看更多</span>');
						}else{
							$("#list_more").html('<span></span>');
						}
						limit++;		
		    }else if(data.status==-103){
	    		$("#list_more").html('<span>没有更多记录！</span>');
	    	}else{
			    $("#list_more").html('<span>没有更多记录！</span>');
			}    	
	    },
	    error : function(xhr, type) {

	    }
	});
}
get_list();
function GetRandomNum(Min,Max)
{   
var Range = Max - Min;   
var Rand = Math.random();   
return(Min + Math.round(Rand * Range));   
}  
</script>

{template 'footer'}